package com.cms.manage.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class MyServletContextListener implements ServletContextListener {
       
	String basePath ="";
	@Override
	public void contextInitialized(ServletContextEvent event) {
		ServletContext context = event.getServletContext();
		basePath = context.getContextPath();
		context.setAttribute("basePath", basePath);
	//	log.info("-----set application attribute basePath="+basePath);	
		try{
			//从配置文件初始化配置参数
			Class.forName("com.eshop.order.common.ConmonConfig");
			System.out.println("配置文件初始化完毕初始化");
		}catch(ClassNotFoundException e){
			//log.error(e.getMessage(), e);
		}		
	}
	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		// TODO Auto-generated method stub
		
	}
	

}
